package dto

import (
	"comm/selfreg"
	"core/class"
	"core/corestruct"
	"reflect"
)

type CommPortDto struct {
	Id           int64  `json:"id,string"                        gorm:"column:id;DEFAULT:0;not null;comment:主键;"`
	Name         string `json:"name"         validate:"required,max=50"   gorm:"column:name;size:50;DEFAULT:'';not null;comment:名称;"`
	CommType     string `json:"commType"     validate:"max=50"   gorm:"column:comm_type;size:50;DEFAULT:'';not null;comment:协议类型;"`
	Port         int32  `json:"port"                             gorm:"column:port;not null;comment:端口;"`
	Timeout      int32  `json:"timeout"                          gorm:"column:timeout;not null;comment:TCP超时;"`
	ReadBuffer   int32  `json:"readBuffer"                       gorm:"column:read_buffer;not null;comment:ReadBuffer;"`
	WriteBuffer  int32  `json:"writeBuffer"                      gorm:"column:write_buffer;not null;comment:WriteBuffer;"`
	LogicTimeOut int32  `json:"logicTimeOut"                     gorm:"column:logic_time_out;not null;comment:逻辑离线时间;"`
	KeepAlive    bool   `json:"keepAlive"                        gorm:"column:keep_alive;not null;comment:是否长连接;"`
	Memo         string `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:备注;"`
	ProxyMode    string `json:"proxyMode"                             gorm:"column:proxy_mode;size:50;DEFAULT:'';not null;comment:代理模式;"`

	Attachs []corestruct.IdNameAttrDto `josn:"attachs" gorm:"-;comment:协议附件;"`
}

func init() {

	var mcls = &CommPortDto{}
	var m = &class.MyClass{
		Name:     "通讯端口Dto",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddDto(m)
}
